import queue
from core.thread.local_queue import LocalQueueAdapter
from core.logger.proxy import logger
from typing import Any
import json


# 消息队列
message_queue = LocalQueueAdapter(queue.Queue(maxsize=1000))
# 事件队列
event_queue = LocalQueueAdapter(queue.Queue(maxsize=1000))


def message_queue_handler(item: Any) -> None:
    # 处理消息的业务逻辑
    data = json.dumps(item)  # 假设 item 是一个可以序列化为 JSON 的对象
    # todo logic
    logger.info(f"message_queue_handler consume: {data}")
